<?php

namespace apiend\modules\passport\controllers;

use Yii;
use apiend\components\Controller;

/**
 * 账号退出登录
 * @author emhome <emhome@163.com>
 * @since 2.0
 */
class LogoutController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * 退出登录
     * @inheritdoc
     */
    public function actionIndex() {
        $user = Yii::$app->user->identity;
        return $user->logout();
    }

}
